import '../pages/health/health_data_model.dart';
import '../providers/user_context.dart';
import '../utils/HttpUtil.dart';

class HealthDataDao {
  static Future<HealthDataModel> fetchMyData() async {
    final response = await HttpUtil.getInstance().get(
        "/api/health/v1/personal/health/data",
        data: {'userId': UserContext.cxt()!.uid});
    if (response?.statusCode == 200) {
      return HealthDataModel.fromJson(response?.data['data']);
    } else {
      return HealthDataModel();
    }
  }
}
